


<!DOCTYPE html>
<!-- Website template by freewebsitetemplates.com -->
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title>Grade Bay</title>
		<link rel="stylesheet" href="gui.css" type="text/css" />
                <link rel="stylesheet" href="style.css" type="text/css" />
		<!--[if IE 7]>
			<link rel="stylesheet" href="css/ie7.css" type="text/css" />
		<![endif]-->
                
                
                
            
	</head>
	<body>
		<div class="page">
			<div class="header">
				<a href="index.php" id="logo"><img src="images/gradeBaylogo.png" width="330" height="79" alt=""/></a>
				<ul>
					<li class="selected"><a href="">STUDENT PROFILE</a></li>
					<li><a href="viewStudentList.php">BACK</a></li>
			
				</ul>
			</div>
			<div class="body">
                            <div class="addsubject">
                           
                            
                            <?php

                            /*
                            * To change this template, choose Tools | Templates
                            * and open the template in the editor.
                            */    
                                     include 'PHPClasses/DBAccess.php';
                                     include 'PHPClasses/StudentDBAccess.php';
                                     include 'PHPClasses/GradeComputation.php';
                                       
                                       
                                       
                                    if(!isset($_POST['studentID'])){
                                        $studID=$_GET['studentID'];
                                    }
                                    else{
                                        $studID=$_POST['studentID'];
                                    }

                                    $DBAccess=new StudentDBAccess();
                                    
                                    $studentProfile=$DBAccess->viewProfile($studID);
                                    $studentContacts=$DBAccess->viewStudentContacts($studID);

                                    extract($studentProfile);
                                    
                                    echo "<table>";
                                    echo "<tr><th><p></p></td></tr>";
                                    echo "<tr><th><p>Student Name:</p></th><td><p>".$studentName."</p></td></tr>";
                                    echo "<tr><th><p>Level:</p></th><td><p>".$studentlvl."</p></td></tr>";
                                    echo "<tr><th><p>Age:</p></th><td><p>".$age."</p></td></tr>";
                                    echo "<tr><th><p>Gender:</p></th><td><p>".$gender."</p></td></tr>";
                                    echo "<tr><th><p>Address:</p></th><td><p>".$address."</p></td></tr>";
                                    echo "<tr><th><p>Contact Number:</p></th><td>";
                                   

                                    while($contacts = mysql_fetch_array($studentContacts)){
                                    extract($contacts);
                                         echo "<p>".$number." </p>";  
                                    }
                                    
                                     echo "</td></tr></table><br/>";
                                     
                                      
                                      
                                     echo "<form name='studentIDForm' action='editStudentProfile.php' method='POST'>
                                     <input type='hidden' value=".$idStudent." name='studentID'/>
                                     <input type='submit' id='saveStud' class='addmore 'value='Edit Profile' name='EditProfile'/>          
                                     </form><br/>";
                                    
                                     echo "<p>Student Subject Grades</p>";
                                     echo "<p style='text-indent: 2em;'>Grade Legends</p>";
                                     echo "<p style='text-indent: 5em; color:green;'>Passed</p>";
                                     echo "<p style='text-indent: 5em; color:red;'>Failed</p>";
                                     echo "<p style='text-indent: 5em; color:blue;'>Excellent</p>";
                                     echo "<p style='text-indent: 5em;'>Average Grade</p>";
                                      
                                      
                                    $DBAccess->viewStudentGrades($idStudent,$studentlvl,0);
                               
                                    
                                     
                                    echo "<form name='viewstudentArchiveForm' action='viewGradeHistory.php' method='POST'>
                                    <input type='hidden' value=".$idStudent." name='studentID'/>
                                    <input type='submit' class='addmore' value='View Grade History' name='gradehistory'/>          
                                    </form>";
                                    
                                    $DBAccess->DBDisconnect();
                            ?>   
                            </div>
			</div>
			<div class="footer">
				
				<p>&#169; Copyright &#169; 2011. Company name all rights reserved</p>
				<div class="connect">
					<a href=""><img src="images/paragox.png" width=160" height="110" alt=""/></a>
					<a href=""><img src="images/fblogo.png" width=120" height="100" alt="" style="position:relative; left:-31px"/></a>
					<a href=""><img src="images/harmony.png" width=120" height="100" alt="" style="position:relative; left:0px"/></a>
				</div>
			</div>
		</div>
	</body>
</html>  